QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Creating and Editing Trimeshes

QuickDraw 3D provides routines that you can use to create and manipulate trimeshes. See "Trimeshes" for the definition of a trimesh.

Q3TriMesh_New

You can use the Q3TriMesh_New function to create a new trimesh.

TQ3GeometryObject Q3TriMesh_New (const TQ3TriMeshData *triMeshData);
triMeshData
A pointer to a TQ3TriMeshData structure.

DESCRIPTION

The Q3TriMesh_New function returns, as its function result, a new trimesh having the shape and attributes specified by the triMeshData parameter. If a new trimesh could not be created, Q3TriMesh_New returns the value NULL .

Q3TriMesh_Submit

You can use the Q3TriMesh_Submit function to submit an immediate trimesh for drawing, picking, bounding, or writing.

TQ3Status Q3TriMesh_Submit (
                     const TQ3TriMeshData *triMeshData,
                     TQ3ViewObject view);
triMeshData
A pointer to a TQ3TriMeshData structure.
view
A view.

DESCRIPTION

The Q3TriMesh_Submit function submits for drawing, picking, bounding, or writing the immediate trimesh whose shape and attribute set are specified by the triMeshData parameter. The trimesh is drawn, picked, bounded, or written according to the view characteristics specified in the view parameter.

SPECIAL CONSIDERATIONS

You should call this function only in a submitting loop.

Q3TriMesh_GetData

You can use the Q3TriMesh_GetData function to get the data that defines a trimesh and its attributes.

TQ3Status Q3TriMesh_GetData (
                     TQ3GeometryObject triMesh,
                     TQ3TriMeshData *triMeshData);
triMesh
A trimesh.
triMeshData
On exit, a pointer to a TQ3TriMeshData structure that contains information about the trimesh specified by the triMesh parameter.

DESCRIPTION

The Q3TriMesh_GetData function returns, through the triMeshData parameter, information about the trimesh specified by the triMesh parameter. QuickDraw 3D allocates memory for the TQ3TriMeshData structure internally; you must call Q3TriMesh_EmptyData to dispose of that memory.

Q3TriMesh_SetData

You can use the Q3TriMesh_SetData function to set the data that defines a trimesh and its attributes.

TQ3Status Q3TriMesh_SetData (
                     TQ3GeometryObject triMesh,
                     const TQ3TriMeshData *triMeshData);
triMesh
A trimesh.
triMeshData
A pointer to a TQ3TriMeshData structure.

DESCRIPTION

The Q3TriMesh_SetData function sets the data associated with the trimesh specified by the triMesh parameter to the data specified by the triMeshData parameter.

Q3TriMesh_EmptyData

You can use the Q3TriMesh_EmptyData function to release the memory occupied by the data structure returned by a previous call to Q3TriMesh_GetData .

TQ3Status Q3TriMesh_EmptyData (TQ3TriMeshData *triMeshData);
triMeshData
A pointer to a TQ3TriMeshData structure.

DESCRIPTION

The Q3TriMesh_EmptyData function releases the memory occupied by the TQ3TriMeshData structure pointed to by the triMeshData parameter; that memory was allocated by a previous call to Q3TriMesh_GetData .


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |